package com.cl.ks.controller;

import com.cl.ks.utils.CommonResult;
import com.cl.mvc.controller.BaseController;

import com.cl.ks.entity.SqlTemplate;
import com.cl.ks.service.SqlTemplateService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("statistics")
public class SqlTemplateController extends BaseController<SqlTemplate> {
    private final SqlTemplateService sqlTemplateService;

    public SqlTemplateController(SqlTemplateService service, SqlTemplateService sqlTemplateService, SqlTemplateService sqlTemplateService1) {
        super(service);
        this.sqlTemplateService = sqlTemplateService1;
    }


    @GetMapping("/listByCode")
    public CommonResult listByCode(String code, String area) {
        return sqlTemplateService.list(code, area);
    }

    @GetMapping("/listAll")
    public CommonResult listAll(String area) {
        return sqlTemplateService.listAll(area);
    }
}
